package com.liangfeng.breezebrowser.browsermvp.view;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.liangfeng.breezebrowser.R;
import com.liangfeng.breezebrowser.bean.BrowHistoryBean;

import java.util.List;

/**
 * Created by mozhifeng on 2017/5/25.
 */

class BrowserHistoryAdapter extends BaseAdapter {

    List<BrowHistoryBean> list;
    Context context;

    public BrowserHistoryAdapter(List<BrowHistoryBean> list, Context context) {
        this.list = list;
        this.context = context;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View inflate = LinearLayout.inflate(context, R.layout.item_book_mark, null);
        TextView title = (TextView) inflate.findViewById(R.id.tv_title_bookmark);
        TextView url = (TextView) inflate.findViewById(R.id.tv_url_bookmark);
        title.setText(list.get(position).getTitle());
        url.setText(list.get(position).getUrl());

        return inflate;
    }

    class ViewHold {

    }
}
